package com.itheima.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.mapper.operateMapper;
import com.itheima.pojo.PageBean;
import com.itheima.pojo.logPageBean;
import com.itheima.pojo.operateLog;
import com.itheima.service.operateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class operateLogServiceImpl implements operateLogService {
    @Autowired
    private operateMapper operateMapper;
    @Override
    public PageBean getoperateLog(logPageBean logPageBean) {
        //设置分页条件
        PageHelper.startPage(logPageBean.getPage(),logPageBean.getPageSize());
        List<operateLog> logList = operateMapper.getlogInfo(logPageBean);
        Page<operateLog> page = (Page<operateLog>) logList;
        return new PageBean(page.getTotal(),page.getResult());
    }
}
